import { createRouter, createWebHashHistory } from "vue-router";

let routes = [
  {
    path: "/",
    name: "Home",
    component: () => import("../01-Home/Home.vue"),
  },
  {
    path: "/list",
    name: "List",
    component: () => import("../02-List/List.vue"),
  },
  {
    path: "/cart",
    name: "Cart",
    component: () => import("../03-Cart/Cart.vue"),
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../04-User/Login.vue"),
    meta: {
      hideNav: true,
    },
  },
  {
    path: "/reg",
    name: "Reg",
    component: () => import("../04-User/Reg.vue"),
  },
  {
    path: "/user",
    name: "User",
    component: () => import("../04-User/User.vue"),
    // meta: {
    //   needLogin: true, //需要登陆
    // },
  },
  {
    path: "/home-input",
    name: "Home-input",
    component: () => import("../01-Home/Home-input.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/user-setup",
    name: "User-setup",
    component: () => import("../04-User/User-setup.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/home-gratis",
    name: "Home-Gratis",
    component: () => import("../01-Home/Home-Gratis.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/home-limited",
    name: "Home-Limited",
    component: () => import("../01-Home/Home-Limited.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/home-hot",
    name: "Home-Hot",
    component: () => import("../01-Home/Home-Hot.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/home-fine",
    name: "Home-Fine",
    component: () => import("../01-Home/Home-Fine.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/Home-middleMath",
    name: "Home-MiddleMath",
    component: () => import("../01-Home/Home-MiddleMath.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-chinese",
    name: "Home-Chinese",
    component: () => import("../01-Home/Home-Chinese.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-english",
    name: "Home-English",
    component: () => import("../01-Home/Home-English.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-physics",
    name: "Home-Physics",
    component: () => import("../01-Home/Home-Physics.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-chemistry",
    name: "Home-Chemistry",
    component: () => import("../01-Home/Home-Chemistry.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-highMath",
    name: "Home-HighMath",
    component: () => import("../01-Home/Home-HighMath.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-mathematics",
    name: "Home-Mathematics",
    component: () => import("../01-Home/Home-Mathematics.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-package",
    name: "Home-Package",
    component: () => import("../01-Home/Home-Package.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-sync",
    name: "Home-Sync",
    component: () => import("../01-Home/Home-Sync.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/Home-training",
    name: "Home-Training",
    component: () => import("../01-Home/Home-Training.vue"),
    meta: {
      hideNav: true,
    },
  },

  {
    path: "/home-systemlesson",
    name: "Home-SystemLesson",
    component: () => import("../01-Home/Home-SystemLesson.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-movelessonto",
    name: "Home-MoveLessonTo",
    component: () => import("../01-Home/Home-MoveLessonTo.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-video",
    name: "Home-Video",
    component: () => import("../01-Home/Home-Video.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-cart",
    name: "Home-Cart",
    component: () => import("../01-Home/Home-Cart.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-systemlesson",
    name: "Home-SystemLesson",
    component: () => import("../01-Home/Home-SystemLesson.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },

  {
    path: "/Home-training",
    name: "Home-Training",
    component: () => import("../01-Home/Home-Training.vue"),
    meta: {
      hideNav: true,
    },
  },

  {
    path: "/home-systemlesson",
    name: "Home-SystemLesson",
    component: () => import("../01-Home/Home-SystemLesson.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-movelessonto",
    name: "Home-MoveLessonTo",
    component: () => import("../01-Home/Home-MoveLessonTo.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-video",
    name: "Home-Video",
    component: () => import("../01-Home/Home-Video.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-cart",
    name: "Home-Cart",
    component: () => import("../01-Home/Home-Cart.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-center",
    name: "User-center",
    component: () => import("../04-User/User-center.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-name",
    name: "User-name",
    component: () => import("../04-User/User-name.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-nickname",
    name: "User-nickname",
    component: () => import("../04-User/User-nickname.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-address",
    name: "User-address",
    component: () => import("../04-User/User-address.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-addressTwo",
    name: "User-addressTwo",
    component: () => import("../04-User/User-addressTwo.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-school",
    name: "User-school",
    component: () => import("../04-User/User-school.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-email",
    name: "User-email",
    component: () => import("../04-User/User-email.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-Orders",
    name: "Home-Orders",
    component: () => import("../01-Home/Home-Orders.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-password",
    name: "User-password",
    component: () => import("../04-User/User-password.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-phone",
    name: "User-phone",
    component: () => import("../04-User/User-phone.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-safe",
    name: "User-safe",
    component: () => import("../04-User/User-safe.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-essay",
    name: "Home-essay",
    component: () => import("../01-Home/Home-essay.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/home-showMore",
    name: "Home-showMore",
    component: () => import("../01-Home/Home-showMore.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-about",
    name: "User-about",
    component: () => import("../04-User/User-about.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-down",
    name: "User-down",
    component: () => import("../04-User/User-down.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
  {
    path: "/user-collection",
    name: "User-collection",
    component: () => import("../04-User/User-collection.vue"),
    meta: {
      hideNav: true, //底部导航是否隐藏
    },
  },
];

//判断用户是否登录
// router.beforeEach((to, from, next) => {
//   if (to.meta.needLogin) {
//     if (isLoginEd()) {
//       next();
//     } else {
//       next({
//         name: "Login",
//       });
//     }
//   } else {
//     next();
//   }
// });
//创建路由
export default createRouter({
  routes,
  history: createWebHashHistory(),
});
